package com.marktotop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.marktotop.entity.system.Role;
import com.marktotop.error.SystemException;
import com.marktotop.response.ResultBean;
import com.marktotop.vo.system.RoleVO;

import java.util.List;

/**
 * <p>
 * 角色表 服务类
 * </p>
 *
 * @author MarkToTop
 * @since 2021-07-12
 */
public interface IRoleService extends IService<Role> {


    /**
     * 给角色分配权限
     *
     * @param id
     * @param mids
     * @return
     * @throws SystemException
     */
    boolean authority(Long id, Long[] mids) throws SystemException;

    /**
     * 根据角色id查询所有菜单id
     *
     * @param id
     * @return
     * @throws SystemException
     */
    List<Long> findMenuIdsByRoleId(Long id) throws SystemException;

    /**
     * 角色列表展示(分页实现)
     *
     * @param pageNum
     * @param pageSize
     * @param roleVO
     * @return
     */
    ResultBean findRoleList(Integer pageNum, Integer pageSize, RoleVO roleVO);


    /**
     * 保存角色信息
     *
     * @param roleVO
     * @throws SystemException
     */
    void saveRole(RoleVO roleVO) throws SystemException;

    /**
     * 编辑角色信息
     *
     * @param id
     * @return
     * @throws SystemException
     */
    RoleVO editRole(Long id) throws SystemException;

    /**
     * 更新角色信息
     *
     * @param id
     * @param roleVO
     */
    void updateRole(Long id, RoleVO roleVO) throws SystemException;

    /**
     * 更新角色状态
     *
     * @param id
     * @param status
     * @throws SystemException
     */
    void updateStatus(Long id, Boolean status) throws SystemException;
}
